.section .text, "ax"

/**
 * get the affinity of cpu
 * @prototype: mx_usize_t GetAffinity (void)
 */
.global GetAffinity
.type GetAffinity, "function"
GetAffinity:
    str x1, [sp, #-8]!
    mrs x0, MPIDR_EL1       // x0 = MPIDR_EL1
    ubfx x1, x0, #32, #8    // x1[7:0] = MPIDR_EL1.aff3
    bfi  w0, w1, #24, #8    // x0[31:24] = x1[7:0]
    ldr x1, [sp], #8
    ret

/**
 * function [ mx_cpu_getid ] implementation
 * @prototype: mx_usize_t mx_cpu_getid (void)
 */
.global mx_cpu_getid
.type mx_cpu_getid, "function"
mx_cpu_getid:
    mov x0, xzr
    ret
